<?php

namespace common\models\cms;

use Yii;

/**
 * This is the model class for table "{{%cms_attach}}".
 *
 * @property int $id
 * @property int $article_id 文章ID
 * @property int $format 附件格式：0图1视频
 * @property string|null $path 附件地址
 * @property int $duration 时长
 * @property int $width 图片宽度
 * @property int $height 图片高度
 * @property int $size 图片大小
 * @property string|null $description 描述
 * @property string|null $source_name 源文件名称
 * @property int $created_at
 * @property int $updated_at
 * @property int $deleted_at
 */
class CmsAttach extends \common\db\ActiveRecord {

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return '{{%cms_attach}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['article_id', 'format', 'duration', 'width', 'height', 'size', 'created_at', 'updated_at', 'deleted_at'], 'integer'],
            [['path', 'description'], 'string', 'max' => 255],
            [['source_name'], 'string', 'max' => 50],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'article_id' => '文章ID',
            'format' => '附件格式：0图1视频',
            'path' => '附件地址',
            'duration' => '时长',
            'width' => '图片宽度',
            'height' => '图片高度',
            'size' => '图片大小',
            'description' => '描述',
            'source_name' => '源文件名称',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
            'deleted_at' => 'Deleted At',
        ];
    }

}
